import Vue from 'vue'
import App from './App.vue'
//引入 vue-router模块
import Router from 'vue-router'
import Home from "./pages/Home.vue";
import Order from "./pages/Order";
import Axios from 'axios'
import VueAxios from 'vue-axios'
import ItemList from "./pages/ItemList";
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
import Login from "./pages/Login";
Vue.use(VueAwesomeSwiper)
Axios.defaults.baseURL = 'http://yfb.neuedu.com:8812'
Vue.use(Router)
//顺序不要写反了
Vue.use(VueAxios,Axios)

//配置路由组件
const routes = [
  {
    path : '/home',
    component:Home
  },{
    path : '/order',
    component:Order
  },{
    path:'/login',
    component:Login
  }, {
    path:'/itemList',
    name:'itemList',
    component:ItemList
  },{
    path : '*',
    component:Home
  }
]
//创建Router实例
//在创建Router实例的时候，传递我们所有的路由配置
const router = new Router({
  routes
})
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
